﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using DTO;
using DataService;

public partial class UserControls_MainContactSubmit : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }

    public string CompanyName
    {
        get { return txtCompany.Text; }
        set { txtCompany.Text = value; }
    }

    public Contact Contact
    {
        set
        {
            PersonControl1.Person = value;

            if (value.Location != null)
            {
                LocationControl1.Location = value.Location;
            }
        }
        get
        {
            Contact contact = ( Contact ) PersonControl1.Person;
            contact.Location = LocationControl1.Location;
            return contact;
        }
    }
}